import request from '@/utils/request'

export function getProducts(categoryId = null) {
    return request({
        url: '/products',
        method: 'get',
        params: categoryId ? { categoryId } : {}
    })
}

export function getCategories() {
    return request({
        url: '/categories',
        method: 'get'
    })
}

export function getProductDetail(id) {
    return request({
        url: `/products/${id}`,
        method: 'get'
    })
} 